<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSongsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('songs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->comment('歌曲名');
            $table->string('song_id')->comment('歌曲id');
            $table->text('song_images')->nullable()->comment('歌曲图片');
            $table->string('singer_id')->comment('歌手id');
            $table->string('singer')->comment('歌手');
            $table->string('tags')->comment('歌曲风格');
            $table->string('album_name')->comment('专辑');
            $table->string('album_id')->comment('专辑id');
            $table->text('album_images')->nullable()->comment('专辑图片');
            $table->string('content_id')->comment('内容id');
            $table->string('copyright_id')->comment('版权id');
            $table->string('invalidate')->nullable()->comment('过期时间');
            $table->string('lrc_url')->nullable()->comment('歌词url');
            $table->string('mrc_url')->nullable()->comment('歌词url');
            $table->string('top_quality')->comment('默认音质');
            $table->string('top_url')->comment('默认播放地址');
            $table->text('rate_formats')->comment('所有播放地址');
            $table->boolean('status')->nullable()->default(true)->comment('状态');
            $table->integer('created_at')->nullable()->default(0)->comment('创建时间');
            $table->integer('deleted_at')->nullable()->default(0)->comment('删除时间');
            $table->integer('flag')->nullable()->default(0);
            $table->charset = 'utf8mb4';
            $table->collation = 'utf8mb4_unicode_ci';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('songs');
    }
}
